﻿<%@ Page Title="About Us" Language="C#" MasterPageFile="~/Forum.master" AutoEventWireup="true" CodeBehind="SignUpPage.aspx.cs" Inherits="Client.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="head">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/javascript" src="Scripts/json2.js"></script>
<script type="text/javascript" src="Scripts/json_parse.js"></script>
<script type="text/javascript" src="Scripts/json_parse_state.js"></script>
<script type="text/javascript" src="Scripts/cycle.js"></script>
<script type="text/javascript" src="Scripts/1.js"></script> 

<script src="Scripts/jquery-1.8.2.js"></script>
    <script src="Scripts/jquery-ui-1.9.1.custom.js"></script>
    <link rel="stylesheet" href="Styles/jquery-ui-1.9.1.custom.css" />

    <link rel="stylesheet" href="Styles/jquery-ui.css" />
<script language="JavaScript" type="text/javascript">

    $(function () {
        $("input[type=button]")
            .button()
            .click(function (event) {
                event.preventDefault();
            });
        function Post() {
            jQuery.support.cors = true;
            var Name = $('#Text1').val();
            var pass = $('#Text2').val();
            var url = $('#Text3').val();
            
            if (url == "")
                url = "http://www.marketingbelly.com/sites/all/themes/clean/images/User.png";
            alert(url + "-" + $('#Text3').val());
            var comfirm = $('#Text4').val();
            var a = 0;
            if (Name.length < 6) {
                a = 1;
                alert('UserName:Number digits must >=6');
            }

            if (pass.length < 6) {

                a = 1;
                alert('Pass:Number digits must >=6');
            }
            if (a == 0) {
                if ($('#Text2').val() == $('#Text4').val()) {
                    $.ajax({
                        url: 'http://localhost:18796/api/values/?Name=' + Name + '&pass=' + pass + '&id=1&url=' + url + '&type=0',
                        type: 'GET',
                        datatype: 'json',
                        //contentType: "application/json;charset=utf-8",
                        success: function (data) {
                            if (data == true) {
                                alert('Successful ... Wait for a moment !');
                                cancel();
                            }
                            else {
                                alert('Please Try Again ...');
                            }
                        },
                        error: function () {
                            alert("loi roi");
                        }
                    });
                }
            }
            else {
                alert('Pass and Confirm is diffirent!');
            }
        }
        $("#Sign")
            .button()
            .click(function () {
                Post();
            });
        $("#Cancel")
            .button()
            .click(function () {
                cancel();
            });
        function cancel() {
            window.location = "MainBlog.aspx";
        }
    });

   

</script>
    <style type="text/css">
        .style1
        {
            width: 135px;
            color: #0000FF;
            font-weight: 700;
        }
        #Text1
        {
            width: 196px;
        }
        #Text2
        {
            width: 194px;
        }
        #File1
        {
            width: 194px;
        }
        #Text3
        {
            width: 194px;
        }
        .style2
        {
            width: 135px;
            color: #000000;
            font-weight: 700;
        }
        #Text4
        {
            width: 194px;
        }
        </style>
    
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">

  <div style="height: auto; width: 98%; background-color: #FFFFFF;">
            <div align="center" 
                style="height: 50px; background-color: #444444; width: 100%;">
                <br />
                <asp:Label ID="Label16" runat="server" Font-Bold="True" Font-Size="XX-Large" 
                    ForeColor="White" Text="Đăng Ký Tài Khoản"></asp:Label>
            </div>

 </div>
 <div style="">
      <div style="float:inherit; width: 91%; height: 215px; padding-top: 20px;padding-left:20px;"
          align="right">
          <form id="Fom11"  method="post" action="" enctype="multipart/form-data">
          <table style="width:100%;">
              <tr>
                  <td class="style2">
                      UserName :</td>
                  <td align="left">
                      <input id="Text1" name="a1" type="text" maxlength="15"/></td>
              </tr>
              <tr>
                  <td class="style2">
                      Password :</td>
                  <td align="left">
                      <input id="Text2" name="a2"type="password" maxlength="15"/></td>
              </tr>
              <tr>
                  <td class="style2">
                      Confirm Password :</td>
                  <td align="left">
                      <input id="Text4" name="a3"type="password" maxlength="15"/></td>
              </tr>
              <tr>
                  <td class="style2">
                      Avatar : </td>
                  <td align="left">
                      <input id="Text3" type="text" value=""/></td>
              </tr>
              <tr>

                  <td align="right" class="style1">
                  
                      <input id="Sign" type="button" value="Sign Up"/></td>
                  <td align="center">
                      <input id="Cancel" type="button" value="Cancel" onclick="return Cancel_onclick()" /></td>
              </tr>
          </table>
          </form>
     </div>
 </div>

</asp:Content>
